//
//  iCanViewController.h
//  iCan - iPhone Context-Aware Navigation
//  Carnegie Mellon University - 18-842 Distributed Systems
//
//  Created by Andrew Santell on 3/26/12.
//  Copyright (c) 2012 Andrew Santell. All rights reserved.

#import <UIKit/UIKit.h>
#import "Hosts.h"
#import "iCanAppDelegate.h"

@interface iCanViewController: UIViewController <UITextFieldDelegate, NSStreamDelegate>
{
    NSString *message;
    NSInputStream *inputStream;
    NSOutputStream *outputStream;
    NSString *result;
    iCanAppDelegate *appDelegate;
}

@property (weak, nonatomic) IBOutlet UITextField *passText;
@property (weak, nonatomic) IBOutlet UITextField *userText;
@property (retain, nonatomic) NSString *message;
@property (retain, nonatomic) NSInputStream *inputStream;
@property (retain, nonatomic) NSOutputStream *outputStream;
@property (retain, nonatomic) NSString *result;
@property (retain, nonatomic) iCanAppDelegate *appDelegate;

- (IBAction)login:(id)sender;
- (void) initNetworkCommunication;
- (void) stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent;
- (void) analyzeResult;

@end
